package com.qf.homework2.controller;

import com.qf.homework2.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/addUser")
    public String addUser(User user){
        System.out.println("添加成功");
        System.out.println("数据为"+user);
        return "redirect:/user/listUser";
    }


    @RequestMapping("/delUser")
    public String delUser(Integer id){
        System.out.println("删除id为"+id+"的User数据");
        return "redirect:/user/listUser";
    }

    @RequestMapping("/listUser")
    public String listUser(){
        System.out.println("查询数据");
        return "forward:/views/user.html";
    }
}
